package com.zyh.flink.day02.transform;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class MapTest {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment environment = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStreamSource<Integer> data = environment.fromElements(1, 2, 3, 4, 5);
        SingleOutputStreamOperator<Object> result = data.map(new MapFunction<Integer, Object>() {
            @Override
            public Object map(Integer integer) throws Exception {
                return integer*10;
            }
        });
        result.print();

        environment.execute("mapJob");
    }
}
